<?php
session_start();
include_once ("../php/connect_mysql.php");
$cid = $_GET['cid'];
$sql1 = "SELECT * FROM comment_info WHERE cid = $cid";
$result = $conn->query($sql1);
//得到当前id的留言内容
if ($result->num_rows > 0) {
    $res = $result->fetch_assoc();
    $uid = $res["id"];
    if($_SESSION['uid']==$uid){
        //删除语句
        $sql = "DELETE FROM `comment_info` WHERE cid = $cid";
        //执行sql语句
        $conn->query($sql);
        echo "<script>window.location.href = '../index.php';</script>";
    }
    else
    {
        echo "<script>alert('此无权限！');window.location.href = '../index.php';</script>";
    }
};